#ifndef MEASUREPAGE_P2_H
#define MEASUREPAGE_P2_H

#include <QWidget>
#include "Charts/measurepagecharts.h"
#include "Beans/userinfobeab.h"
#include "Beans/databeans.h"
#include "QMediaPlayer"
#include <QAudioOutput>
namespace Ui {
class MeasurePage_P2;
}

class MeasurePage_P2 : public QWidget
{
    Q_OBJECT

public:
    explicit MeasurePage_P2(QWidget *parent = nullptr);
    ~MeasurePage_P2();
    void setBg();
    void InitialChartView();
    void initControl(int p);

private slots:
    void on_bt_ok_p1_clicked();

    void on_bt_ok_p2_clicked();

    void InitialControl2();

    void getPPGData(double ppg1,double appg1,double ppg2,double appg2);

    void getSPOXData(double spox,int p);

    void getHRData(unsigned char hr,int p);

    void getRRData(int RR,int p);

    void getProgressData2(int p,int persion);

    void getOver2(int p);


    void on_bt_return_clicked();

    void on_bt_print_clicked();

    void on_bt_gotoFirst_2_clicked();

    void on_bt_gotoFirst_clicked();

    void on_bt_print_2_clicked();

    void on_lineEdit_ID_editingFinished();

    void on_lineEdit_ID_2_editingFinished();

private:
    Ui::MeasurePage_P2 *ui;
    QChart *ppg_Chart;
    QChart *appg_Chart;
    QChart *hrv_Chart;
    MeasurePageCharts MPC;
    QChart *ppg_Chart2;
    QChart *appg_Chart2;
    QChart *hrv_Chart2;
    int pos1,pos2;
    UserInfoBeab uib1,uib2;
    DataBeans dbs1,dbs2;
    QMediaPlayer *myplayer ;
    QAudioOutput *audioOutput;
    QString printType;

signals:

//    void SendUserInfoToResult(UserInfoBeab uid);
    void sendStartOrStop2(bool b,int p);
    void sendUserInfo2Thread2(UserInfoBeab uib,int p);
};

#endif // MEASUREPAGE_P2_H
